package com.lufei.dh.bottom.Adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lufei.dh.R;
import com.lufei.dh.bottom.Bean.GlideCircleTransform;
import com.lufei.dh.bottom.Bean.Horizontal_Item;

import java.util.List;

/**
 * 版权：易金卡沃 版权所有
 * <p>
 * 作者：lufei
 * <p>
 * 创建日期：2018/7/10
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
public class Adapter_hor extends BaseQuickAdapter<Horizontal_Item,BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    Context context;
    public Adapter_hor(List<Horizontal_Item> data,Context context) {
        super(R.layout.item_horizontal__item,data);
        this.context=context;

    }

    @Override
    protected void convert(BaseViewHolder helper, Horizontal_Item item) {
      ImageView imageView= helper.getView(R.id.id_hor_image);
        Glide.with(context).load("").centerCrop().placeholder(R.drawable.ic_launcher)
                .transform(new GlideCircleTransform(context))
                .diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView);
        helper.setText(R.id.id_hor_time,item.getTime());
    }
}
